package org.swings.builder;

import java.util.List;

import org.apache.log4j.Logger;
import org.swings.builder.components.FormComponent;

/**
 * <p>
 * <b>Overview:</b>
 * <p>
 * 
 * 
 * <pre>
 * Creation date: Feb 16, 2015
 * @author Amit Kshirsagar
 * @version 1.0
 * @since
 * 
 * <p><b>Modification History:</b><p>
 * 
 * 
 * </pre>
 */

public class FormBuilder extends JComponentBuilder {
	static Logger log = Logger.getLogger(FormBuilder.class.getName());

	public static List<FormComponent> getFormComponentsForPanel(String panel,
			String applicationComponentXml) {
		parseDom2Components(applicationComponentXml);
		List<FormComponent> formComponentList = null;
		for (int i = 0; i < application.getFrame().getPanel().size(); i++) {
			if (application.getFrame().getPanel().get(i).getPanelName()
					.equalsIgnoreCase(panel)
					&& application.getFrame().getPanel().get(i)
							.getSubPanelName().equalsIgnoreCase("FormPanel")) {
				formComponentList = application.getFrame().getPanel().get(i)
						.getFormComponent();
			}

		}
		return formComponentList;
	}

}
